﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using KPIS.GERP.GIMS.MODEL;
using KPIS.GERP.GIMS.DAL;
using KPIS.GERP.GIMS.DALFactory;
using KPIS.DBM;

namespace KPIS.GERP.GIMS.BLL
{
    public class DeliveryNoteBLL
    {
        private static readonly DeliveryNoteDAL dal = DataAccess.CreateDeliveryNote();

        public DeliveryNoteInfo GetDeliveryNote(Nullable<int> dn_seq)
        {
            return dal.GetDeliveryNote(dn_seq);
        }

        public IList<DeliveryNoteInfo> GetDeliveryNote(Nullable<int> YearTypeSeq, Nullable<int> Year, Nullable<int> PurchaseMethodSeq
            , Nullable<int> PurchaseTypeSeq, Nullable<int> OperationNameSeq, string Status)
        {
            return dal.GetDeliveryNote(YearTypeSeq, Year, PurchaseMethodSeq, PurchaseTypeSeq, OperationNameSeq, Status);
        }

        public string Insert(DeliveryNoteInfo info, IList<DeliveryNoteItemInfo> infoListItem, IList<DeliveryNoteItemExtraInfo> infoListExtra, IList<DeliveryNoteCommitteeInfo> infoListCommittee, IList<DeliveryNotePenaltyInfo> infoListPenalty, IList<DocumentInfo> infoListFile)
        {
            return dal.Insert(info, infoListItem, infoListExtra, infoListCommittee, infoListPenalty, infoListFile);
        }

        public void DeleteAll(IList<DeliveryNoteInfo> infoList)
        {
            dal.DeleteAll(infoList);
        }

        public void Update(DeliveryNoteInfo info)
        {
            dal.Update(info);
        }

        public string UpdateTotalAndAmountConfirm(DeliveryNoteInfo info, IList<PrePurchaseRequestItemInfo> infoListPprItem, IList<DeliveryNoteRouteInfo> infoListRoute)
        {
            return dal.UpdateTotalAndAmountConfirm(info, infoListPprItem, infoListRoute);
        }

    }
}
